//类型断言
function abguess(x:number|string):string{
    if((<string>x).length){
        return "a"+(x as string).length
    }else{
        return "b"
    }
}
//类
class Human{
    run ?:()=>void
    sex?:boolean;
    public name:string;
    constructor(name){
        this.name=name;
    }
    protected talk(){
        console.log(this.name)
    }
    private total:number
}
let someone=new Human("zzk");
someone.sex=true;
class Student extends Human{
    school:string
    constructor(name:string){
        super(name);
    }
    study(){
        super.talk();
        console.log("walk");
        this.name;
    }
}
let xiaoming:Student;
xiaoming=new Student("xiaoming");
xiaoming.school="55middle";
//接口
interface Car{
    readonly wheels:number;
    color:string;
    brand?:string
    // run:()=>void;
    run():void
}
let carObj:Car={
    wheels:4,
    color:"white",
    run:()=>{
        console.log(1)
    }
}
export default{};

